package com.xc.service.impl;

import com.xc.mapper.UserMapper;
import com.xc.model.dto.ResultDTO;
import com.xc.model.dto.UserDTO;
import com.xc.model.entity.UserEntity;
import com.xc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public ResultDTO login(UserEntity userEntity) {
        UserDTO login = userMapper.login(userEntity);
        if (login != null) {
            return ResultDTO.data(1, "登录成功");
        }
        return ResultDTO.data(-1, "登录失败");
    }
}
